#pragma once
#include <vector>
#include "NDVector.hpp"


class MultiTouchData
{
private:
  Vector3f _beforeLastPoints[10];
  Vector3f _lastPoints[10];
  Vector3f _curPoints[10];

  int _amountOfCurPoints;
  bool _hasPointAdded;
  bool _hasPointRemoved;

  Vector2f _centerPositionOnGlobe;
  Vector3f _centerAxis;
  Vector3f _lastCenterAxis;
  float _avgDistanceRad;
  float _avgRotationRad;
  float _scaleFromLast;

  void _calcCenterPosition ();
  void _calcAvgDistanceInRad ();
  void _calcAvgRotationInRad ();

public:
  MultiTouchData ();

  void updatePositions (std::vector< Vector3f >& pointsOnGlobe);
  bool addPosition (const Vector3f& newPointOnGlobe);
  void updateAdditionalInfo ();

  Vector2f getCenterPositionOnGlobe () const;
  Vector3f getCenterAxis () const;
  float getAvgDistanceInRad () const;
  float getAvgRotationInRad () const;
  float getScaleFromLast () const;

  bool hasPointAdded () const;
  bool hasPointRemoved () const;
};
